Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #12266: Handle last RPM sort for more than 10 bootstrap RPMs #83

Merged
merged 1 commit into from
Apr 21, 2016

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Apr 20, 2016

Old method of sorting used string based comparisons which after 10
release versions fails to sort properly. This moves to a method of
comparing individual releases via integer comparison to derive the
latest boostrap RPM.

Old method of sorting used string based comparisons which after 10
release versions fails to sort properly. This moves to a method of
comparing individual releases via integer comparison to derive the
latest boostrap RPM.
{'release' => release, 'rpm' => rpm}
end

rpms.sort { |a,b| a['release'].to_i <=> b['release'].to_i }.last
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the RPM version never change, always 1.0? Could that change some day?

The last RPM ends up as 1.0.11 when we have:

["foo-1.0-1.noarch.rpm", "foo-2.0-2.noarch.rpm", "foo-1.0-11.noarch.rpm"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK we don't increment the version (https://github.com/Katello/puppet-certs/pull/83/files/e6df6f10f485e0bf283c428c371fa2606b7faaa5#diff-d7c04bc14bf477574cb5d1f4d285675cR13) only the release when we generate a new bootstrap RPM. So possible that logic could change down the road, but I don't forsee it :)

@stbenjam
Copy link
Member

ACK

@ehelms ehelms merged commit ee7543c into theforeman:master Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants